package com.gxuwz.adminprovider.mapper;

import com.gxuwz.commonmodule.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserMapper {
    /**
     * 用户注册接口
     * @param username
     * @param password
     * @param role
     * @return
     */
    public int register(@Param(value = "username") String username,
                        @Param(value = "name")String name,
                        @Param(value = "password") String password,
                        @Param(value = "phone")String phone,
                        @Param(value = "email")String email,
                        @Param(value = "address")String address,
                        @Param(value = "balance")String balance,
                        @Param(value = "role") String role);
//    public String register(User user);

    /**
     * 用户登陆接口
     * @param username
     * @param password
     * @param role
     * @return
     */
    @Select("select * from user where username=#{username} and password=#{password} and role=#{role}")
    public User login(@Param(value = "username")String username,@Param(value = "password") String password,@Param(value = "role") String role);


}
